#include <Def.h>
#include <qjsonarray.h>
#include <qdebug.h>
#include <osgEarthQt/ViewerWidget>
#include "SDKCore.h"
#include "SDKCorePrivate.h"

void SDKCore::captureImageCallback(const QString& file,bool flag)
{
}

SDKCore::SDKCore():
d_ptr(new SDKCorePrivate(this))
{
}

SDKCore::~SDKCore()
{
	d_ptr->deleteLater();
}

SDKCore* SDKCore::instance()
{
    static SDKCore sdkcore;
	return &sdkcore;
}

void SDKCore::init()
{
	qDebug() << "SDKCore::init";
    d_func()->initial();
}

Helper* SDKCore::getHelper()const
{
	return d_func()->getHelper();
}

ScriptExecutor* SDKCore::getScriptExecutor()const
{
	return d_func()->getScriptExecutor();
}

Text* SDKCore::getText()const
{
	return d_func()->getText();
}

StyleManager* SDKCore::getStyleManager()const
{
	return d_func()->getStyleManager();
}

EarthGraticule* SDKCore::getEarthGraticule()const 
{ 
	return d_func()->getEarthGraticule();
}

ICamera* SDKCore::getCamera()const
{
	return d_func()->getCamera();
}

LayerManager* SDKCore::getLayerManager()const
{
	return d_func()->getLayerManager();
}

/*
DynTargetManager* SDKCore::getDynTargetManager()const 
{ 
	return d_func()->getDynTargetManager();
}*/

void SDKCore::asyncCaptureImage(const QString& file,std::function<void(const QString&,bool)> fn)
{
	d_func()->asyncCaptureImage(file,fn);
}